﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace EbookReader.Components.Pages
{
    public partial class ContentView
    {
        public string DocumentPath { get; set; }

        public ContentView()
        {
            DocumentPath = testBookFile;
        }
        static string testBookFile
        {
            get
            {
                return Path.Combine(AppContext.BaseDirectory, "../../../../../Resources/Test/心灵能量.pdf");
            }
        }
        //public string GetPdfSource()
        // {
        //     var name = "心灵能量.pdf";

        //     var assembly = Assembly.GetExecutingAssembly();
        //     string resourceName = assembly
        //         .GetManifestResourceNames()
        //         .Single(str => str.EndsWith(name));

        //     byte[] bytes;
        //     using (Stream stream = assembly.GetManifestResourceStream(resourceName))
        //     {
        //         bytes = new byte[stream.Length];
        //         stream.Read(bytes, 0, bytes.Length);
        //     }

        //     var fileName = Path.Combine(Path.GetTempPath(), name);
        //     File.WriteAllBytes(fileName, bytes);

        //     return fileName;
        // } 

    }
}
